package org.langke.web;

import cn.hutool.json.JSONUtil;
import org.langke.nacos.NacosConfigCenterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DemoController {

    @Autowired
    NacosConfigCenterService nacosConfigCenterService;

    @GetMapping("/")
    public String index(){
        return "ok";
    }

    @GetMapping("/getConfig")
    public String getConfig(){
        return JSONUtil.toJsonPrettyStr(nacosConfigCenterService.getDemoConfig());
    }
}
